1. Field of the Invention
This invention relates to the field of scheduling electronic and computer resources.
2. Background
There are many circumstances where a resource is shared between elements. For example, the resources of a computer system are shared by the programs executing in the computer system. In a computer system, one particular example of a shared resource is the time available to the processor that executes programs stored in the computer's memory. This resource (the processor time) is allocated to elements in the computer system (threads-of-execution) that use the processor time.
Another example of a shared resource occurs in an output-queued data switch. Such a switch dispatches data received from an input port to a queue associated with the destination output port. The queue then feeds the output port. There can be a number of queues for each output port. The shared resource is the amount of time each queue (an element) has access to the output port. In other words, the shared resource is the output port's bandwidth.
In both of these cases (and many others), the available time of the resource is shared between multiple elements under control of a scheduling mechanism that implements a scheduling algorithm. The scheduling mechanism can include programmed processes that are executed by a processor to effect a scheduling algorithm, circuitry that effectuates a scheduling algorithm, or other known mechanisms. In addition, the scheduling mechanism may be preemptive or non-preemptive. In the case of a computer system, a preemptively scheduling operating system allocates a quantum of processor time to an element and potentially schedules another element (for example, when the quantum of time expires, if the element relinquishes the processor, or for other reasons). In the case of a non-preemptively scheduling operating system, each element must explicitly give other elements the opportunity to access the processor.
There are many known scheduling algorithms. Some of these algorithms are designed to fairly allocate the resource between the elements. Fairness can be defined as each element asymptotically (over time) receiving its weighted share of the resource's time. Other definitions of fairness are known in the art.
The greater the element's weight, the greater its fair share of the resource. Letting R(t) denote the set of all competing elements at time t, the instantaneous fair share of an element i at time t is defined as:
            f      i        ⁡          (      t      )        =            w      i                      ∑                  j          ∈                      R            ⁡                          (              t              )                                          ⁢              w        j            
Known scheduling algorithms include weighted fair queuing scheduling, round robin scheduling, priority based scheduling, deadline scheduling, and other scheduling algorithms. One problem with the known alt is that often an element is sensitive to latency. One example of a latency-sensitive element in a computer system is a program that displays video images. Each frame needs to be promptly displayed after the expiration of a timer. If the frame is delayed, the displayed video will appear jerky. Another example of a latency-sensitive element is a high service requirement data packet queue (containing, for example, voice or video data) flowing through a data switch. The data switch performance will be inadequate if the data packet is not transferred to the output port of the data switch within its service requirement. In both of these examples, the purpose of the element is degraded if the required resource is not available when needed.
Deadline scheduling techniques allow an element to declare its future resource needs and to request that the scheduler accommodate the declared need. The scheduler may accept or decline this request (if declined, the scheduler treats the requesting element in its default manner). One problem with this approach is that it is difficult for an element to determine how much of the resource the element requires. Other problems are: that if multiple elements declare more resource capability than is available, other elements may be starved for the resource; that the system is unpredictable if some of the declaring elements that request resource are accepted and other elements denied; that the elements often incorrectly estimate their resource need; and that the deadline scheduling is complex to implement.
Although, latency-sensitive elements can be scheduled using a priority-based algorithm such scheduling is often unfair and can lead to resource starvation of lower priority elements.
It would be advantageous to schedule a resource between elements to maintain a fair long-term allocation of the resource to the elements while still satisfying the responsive needs of latency-sensitive elements. Such scheduling would improve the performance of a device that maintains a fair long-term allocation of a resource to multiple elements while still handling latency-sensitive elements. As applied to a computer system, such a thread-of-execution scheduling system would improve the performance of the computer system. As applied to a data switch, such an output port scheduling algorithm would improve the performance of the latency-sensitive data streams through the switch.